﻿<%@ Page ContentType="application/rss+xml" Language="C#" Inherits="System.Web.Mvc.ViewPage<cludg.Web.ViewModels.CommentFeedModel>" %>
<%@ Import Namespace="cludg.Web.Core.RenderHelpers" %><?xml version="1.0" encoding="utf-8" ?>
<%
	var maxSubjectLength = 50;
%>
<rss version="2.0">
<channel>
<title><%: Model.SiteName %> - Комментарии к '<%: Model.Story.Title %>'</title>
<link></link>
<description>Подписка на комментарии к истории '<%:  Model.Story.Title%>'</description>
<lastBuildDate><%= DateTime.Now.ToUniversalTime().ToString("r")%></lastBuildDate>
<language>ru-ru</language>
<% foreach (var comment in Model.Story.Comments.Where(x => !x.IsDeleted).OrderByDescending(x => x.CreationTime).Take(20))
   { %>
	<item>
		<title><%: Html.TrimLongText(comment.Text, maxSubjectLength) %></title>
		<link><%: Url.RouteUrl("Story", new RouteValueDictionary { { "name",  Model.Story.UniqueName } }, "http", Request.Url.Host)%>#comment_<%: comment.Id %></link>
		<guid isPermaLink="true"><%: Url.RouteUrl("Story", new RouteValueDictionary { { "name", Model.Story.UniqueName } }, "http", Request.Url.Host)%>#comment_<%: comment.Id %></guid>
		<pubDate><%: comment.CreationTime.ToUniversalTime().ToString("r") %></pubDate>
		<description><%: comment.Text %></description>
		<author><%: Html.Encode(comment.Author.DisplayName)%></author>
	</item>
<% } %>
</channel>
</rss>